package com.maozi.system.permission.api.rest.v1.platform;

import java.util.List;

import javax.validation.Valid;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.maozi.base.result.DropDownResult;
import com.maozi.common.result.AbstractBaseResult;
import com.maozi.system.role.vo.v1.platform.RoleInfoVo;
import com.maozi.system.role.vo.v1.platform.RoleListVo;
import com.maozi.user.role.dto.v1.platform.RoleSaveUpdateParam;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

@Tag(name = "【平台】【V1】角色模块")
@RequestMapping("/role/platform/v1")
public interface RestRoleServiceV1 {
	
	@GetMapping(value="/list")
	@Operation(summary = "列表")
//	@PreAuthorize("hasAuthority('system:role:list')")
	AbstractBaseResult<List<RoleListVo>> restList();
	
	@PostMapping(value="/save")
	@Operation(summary = "保存")
//	@PreAuthorize("hasAuthority('system:role:save')")
	AbstractBaseResult<Long> restSave(@RequestBody @Valid RoleSaveUpdateParam param);
	
	@GetMapping(value="/dropDownList")
	@Operation(summary = "下拉列表")
//	@PreAuthorize("hasAuthority('system:role:save') or hasAuthority('system:role:update')")
	AbstractBaseResult<List<DropDownResult>> dropDownListResult();
	
	@Tag(name = "【平台】【V1】角色模块")
	@RequestMapping("/role/platform/v1/{id}")
	public interface RestRoleServiceCurrentV1 {

		@GetMapping(value="/get")
		@Operation(summary = "详情")
//		@PreAuthorize("hasAuthority('system:role:get')")
		AbstractBaseResult<RoleInfoVo> restGet(@PathVariable Long id);
		
		@PostMapping(value="/remove")
		@Operation(summary = "删除")
//		@PreAuthorize("hasAuthority('system:role:remove')")
		AbstractBaseResult<Void> restRemove(@PathVariable Long id);
		
		@PostMapping(value="/update")
		@Operation(summary = "更新")
//		@PreAuthorize("hasAuthority('system:role:update')")
		AbstractBaseResult<Void> restUpdate(@PathVariable Long id,@RequestBody RoleSaveUpdateParam param);
		
		@PostMapping(value="/updateStatus")
		@Operation(summary = "更新状态")
//		@PreAuthorize("hasAuthority('system:role:update')")
		AbstractBaseResult<Void> updateStatus(@PathVariable Long id);
		
	}

}
